import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userData:1,
    data:[],
    isLogin:window.sessionStorage.getItem('isLogin'),
    username:window.sessionStorage.getItem('name')
  },
  mutations: {
    saveUserData(state,userData){
      state.userData=userData
    },
    updata(state,value){
      state.data=value
    },
    login(state,value){
      console.log('222',value);
      sessionStorage.setItem('isLogin',true)
      sessionStorage.setItem('username',value)
    }
  },
  actions: {
  },
  modules: {
  }
})
